import request from '@/utils/request'
/**
 * 获取权限列表
 * @returns
 */
export const getPermissionListAPI = () => {
  return request.get('/sys/permission')
}
/**
 * 添加权限点接口
 * @param {*} data 添加的数据
 * @returns
 */
export const addPermissionAPI = (data) => {
  return request.post('/sys/permission', data)
}

/**
 * 删除权限点
 * @param {*} id 当前数据id
 * @returns
 */
export const removePermissionAPI = (id) => {
  return request.delete(`/sys/permission/${id}`)
}
/**
 * 获取权限点详情
 * @param {*} id 当前数据id
 * @returns
 */
export const getPermissionAPI = (id) => {
  return request.get(`/sys/permission/${id}`)
}
/**
 * 编辑权限
 * @param {*} data 修改后的数据
 * @returns
 */
export const editPermissionAPI = (data) => {
  return request.put(`/sys/permission/${data.id}`, data)
}
